@extends('admin.layout.layout', ['row' => @$page])

@section('title', @$page['title'])

@section('contain')

    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions">
                <div class="item">
                </div>
            </div>
        </div>

        <div>
            <form action="./" method="post" onsubmit="return checkVal(this)">
                @csrf
                <input type="text" name="_previous_" value="{{ request()->header('referer') }}" hidden>

                <div class="form-item form-s1">
                    <div class="form-label" required>{{ ts('PRODUCTTYPE') }}</div>
                    <div class="form-input">
                        <select name="product_type_id" class="form-control" data-value="{{ @$data->product_type_id  }}">
                            <option value="">-{{ ts('SELECT') }}-</option>
                            @foreach(\App\Models\ProductTypes::get(['id']) as $v)
                                <option value="{{ $v->id }}" {{  @$data->product_type_id==$v->id ? 'selected' : '' }}>{{ ts('product_types.'.@$v->id) }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>

                <div class="form-item form-s1">
                    <div class="form-label" required>{{ ts('ENGLISH') }}</div>
                    <div class="form-input">
                        <input type="text" class="form-control" name="english_value" value="{{ $data['english_value'] }}">
                    </div>
                </div>
                <div class="form-item form-s1">
                    <div class="form-label" required>{{ ts('CHINESET') }}</div>
                    <div class="form-input">
                        <input type="text" class="form-control" name="traditional_chiness_value" value="{{ $data['traditional_chiness_value'] }}">
                    </div>
                </div>
                <div class="form-item form-s1">
                    <div class="form-label" required>{{ ts('CHINESES') }}</div>
                    <div class="form-input">
                        <input type="text" class="form-control" name="simplified_chiness_value" value="{{ $data['simplified_chiness_value'] }}">
                    </div>
                </div>
                <div class="form-item form-s1">
                    <div class="form-label" required>{{ ts('PX') }}</div>
                    <div class="form-input">
                        <input type="number" class="form-control" name="order" value="{{ $data['order'] }}">
                        <div class="text">数字越小越靠前</div>
                    </div>
                </div>
                <div class="form-item form-s1">
                    <div class="form-label" required>有效期(单位天)</div>
                    <div class="form-input">
                        <input type="text" class="form-control" name="warranty_days" value="{{ $data['warranty_days'] }}">
                    </div>
                </div>
                <div class="mt-4 mx-3">
                    <button class="btn btn-primary">{{ ts('store') }}</button>
                </div>
            </form>
        </div>

    </div>

@endsection

@section('script')
    <script>

    </script>
@endsection
